Creates a treeview for the registry similar to regedit by recursively calling RegEnumKey.

=================================================


$hGUI = GUICreate ("test", 500, 500, -1, -1)
Global $hCanc = GUICtrlCreateButton ("Cancel", 2, 2, 80, 20)
Global $hTree = GUICtrlCreateTreeView (2, 24, 496, 474)

GUISetState ()

$hComp = GUICtrlCreateTreeViewItem ("My Computer", $hTree)

$hRoot = GUICtrlCreateTreeViewItem ("HKEY_CLASSES_ROOT", $hComp)
_EnumRegKeys ("HKCR", $hRoot)
$hRoot = GUICtrlCreateTreeViewItem ("HKEY_CURRENT_USER", $hComp)
_EnumRegKeys ("HKCU", $hRoot)
$hRoot = GUICtrlCreateTreeViewItem ("HKEY_LOCAL_MACHINE", $hComp)
_EnumRegKeys ("HKLM", $hRoot)
$hRoot = GUICtrlCreateTreeViewItem ("HKEY_USERS", $hComp)
_EnumRegKeys ("HKU", $hRoot)
$hRoot = GUICtrlCreateTreeViewItem ("HKEY_CURRENT_CONFIG", $hComp)
_EnumRegKeys ("HKCC", $hRoot)

While GUIGetMsg () <> -3
   Sleep (10)
WEnd

Func _EnumRegKeys ($sPar, $hItem)
   Local $i = 0
   While 1
      $i += 1
      $var = RegEnumKey ($sPar, $i)
      If @Error then ExitLoop
      $hNewItem = GUICtrlCreateTreeViewItem ($var, $hItem)
      _EnumRegKeys ($sPar & "\" & $var, $hNewItem)
   WEnd
EndFunc ; ==> _EnumRegKeys